package ui;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JRadioButton;

import session.Session;

public class SettingPanel extends JComponent {

	private final Session session;
	private JRadioButton mapFollowsZoomButton;

	public SettingPanel(Session session) {
		this.session = session;
		setLayout(new FlowLayout());
		
		mapFollowsZoomButton = new JRadioButton("Follow Zoom");
		mapFollowsZoomButton.setSelected(true);
		mapFollowsZoomButton.addActionListener(new MapFollowsZoom());
		session.setMapFollowsZoom(mapFollowsZoomButton.isSelected());
		add(mapFollowsZoomButton);//, BorderLayout.CENTER);
	}
	
	class MapFollowsZoom extends AbstractAction {

		@Override
		public void actionPerformed(ActionEvent e) {
			session.setMapFollowsZoom(mapFollowsZoomButton.isSelected());
		}
		
	}
	
}
